import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '违规人员',
    align:"center",
    dataIndex: 'userName'
   },
   {
    title: '违规次数',
    align:"center",
    dataIndex: 'violationsNumber'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
];
//列表数据
export const columnsItem: BasicColumn[] = [
  {
    title: '违规时间',
    align:"center",
    dataIndex: 'violationTime'
   },
   {
    title: '违规席位',
    align:"center",
    dataIndex: 'violationSeatName'
   },
   {
    title: '违规原因',
    align:"center",
    dataIndex: 'violationReason'
   },
   {
    title: '原因分析',
    align:"center",
    dataIndex: 'causeAnalysis',
    edit:true
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
     {
      label: "席位",
      field: "seatName",
      component: 'Input', //TODO 范围查询
      //colProps: {span: 6},
	},
	{
      label: "人员",
      field: 'userName',
      component: 'JSelectUser',
      componentProps:{
        rowKey: 'id',
        // update-begin--author:liaozhiyang---date:20240701---for：【TV360X-1627】通知公告用户选择组件没翻译
        labelKey: 'realname',
        isRadioSelection:true
      },
      //colProps: {span: 6},
 	},
];
//查询数据
export const searchItemFormSchema: FormSchema[] = [
  {
   label: "违规席位",
   field: "seatName",
   component: 'Input', //TODO 范围查询
   //colProps: {span: 6},
}
 
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '席位名称',
    field: 'seatName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入席位名称!'},
          ];
     },
  },
  {
    label: '绑定的设备',
    field: 'equipmentId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"gbiac_equipment,name,id"
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入绑定的设备!'},
          ];
     },
  },
  {
    label: '所属公司',
    field: 'company',
     component: 'JSelectDept',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入所属公司!'},
          ];
     },
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  seatName: {title: '席位名称',order: 0,view: 'text', type: 'string',},
  equipmentId: {title: '绑定的设备',order: 1,view: 'sel_search', type: 'string',dictTable: "gbiac_equipment", dictCode: 'id', dictText: 'name',},
  company: {title: '所属公司',order: 2,view: 'sel_depart', type: 'string',},
  remark: {title: '备注',order: 3,view: 'textarea', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}